<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>typeof的功能和用法演示</title>
</head>
<body>
<script  type="text/javascript">
    <!--
    document.write("<h2>对变量或值调用typeof运算符返回值：</h2>");
    var width,height=10,name="rose";
    var date=new Date();   //获取时间日期对象
    var arr=new Array();   //定义数组
    document.write("width: "+typeof(width)+"<br/>");
    document.write("height: "+typeof(height)+"<br/>");
    document.write("name: "+typeof(name)+"<br/>");
    document.write("date: "+typeof(date)+"<br/>");
    document.write("arr: "+typeof(arr)+"<br/>");
    document.write("true: "+typeof(true)+"<br/>");
    document.write("null: "+typeof(null));
    -->
</script>

</body>
</html>